Skip to main content

Quick Start

1

Get your credentials

Find your API key in Settings > API Keys and your Feedback Source ID on your feedback source’s detail page.
2

Add the script tag

Paste this snippet into your HTML, replacing the placeholder values:
3

You're live

A floating “Feedback” button appears in the bottom-right corner with a default text field. Users can click it to submit feedback directly to your BuildBetter feedback source.

Data Attributes

When using the simple script tag, customize basic settings with data-* attributes:

Programmatic API

For full control, use the JavaScript API. The script exposes a global BuildBetterFeedback object.

Instance Methods

BuildBetterFeedback.create() returns a widget instance with the following methods:

Multiple Instances

You can create multiple widget instances on the same page. Each instance is fully isolated with its own Shadow DOM — styles never leak between widgets or affect your page.

Configuration Reference

string
required
Your organization API key (bb_org_...). Found in Settings > API Keys.
string
required
The ID of the feedback source to submit records to.
string
default:"floating"
Display mode. One of floating, popover, inline, or slide-out. See Display Modes.
string
default:"bottom-right"
Trigger button position (floating mode only). One of bottom-right, bottom-left, top-right, top-left.
string
default:"above"
Whether the form opens above or below the button (popover mode only). One of above or below.
string | HTMLElement
CSS selector or DOM element reference for inline and popover modes. Required when mode is inline. Optional for popover — if provided, the button renders inside the container; otherwise it appends to the body.
string
default:"Feedback"
Text displayed on the trigger button (floating, popover, and slide-out modes).
string
default:"Send Feedback"
Title displayed at the top of the feedback form.
FieldConfig[]
Array of field configurations. See Field Types. Defaults to a single required textarea.
ThemeConfig
Visual customization options. See Theming.
PersonConfig
Pre-fill user identity as hidden context. See User Identity.
Record<string, string>
Hidden key-value pairs included with every submission. See Metadata.
boolean
default:"false"
Remove the “Powered by BuildBetter” footer from the widget.
(result: SubmissionResult) => void
Callback fired after a successful submission. Receives an object with id and fields.
(error: Error) => void
Callback fired when a submission fails.
() => void
Callback fired when the widget opens.
() => void
Callback fired when the widget closes.

Display Modes

A floating button fixed to a corner of the viewport. Clicking it opens a feedback card near the button.

Field Types

Configure which fields appear in your feedback form using the fields array. Each field requires a type, name (used as the key when submitting), and label (displayed to the user).
A single-line text input.
A multi-line text area for longer responses.
A row of emoji buttons for quick sentiment feedback. The text label (not the emoji character) is submitted as the value, making it easy to filter and analyze.
Default emojis: angry, sad, neutral, happy, loveYou can customize the emojis and their labels using emojiOptions:
A 1-5 star selector. Submits the numeric value as a string (e.g. "4").
A dropdown with predefined options.
A 0-10 horizontal scale. Submits the numeric value as a string (e.g. "8").

Field Properties

Theming

Customize the widget’s appearance to match your brand. The theme applies to all display modes including the inline form background.
The widget uses theme-relative borders (derived from textColor) so input fields and controls remain visible on both light and dark backgrounds.

User Identity

If your users are already logged in to your application, you can pass their identity to the widget so feedback is automatically linked to the person in BuildBetter — no need to ask them to fill in their name or email.
The person data is sent as hidden context — it is never displayed in the form. When an email is provided, the widget upserts a person record in BuildBetter and links the feedback submission to them. If the person already exists (matched by email), their record is reused. Name fields are only updated when provided — omitting them won’t overwrite existing data.

Metadata

Pass hidden key-value data with every submission. Metadata fields are never shown in the form — they’re submitted automatically alongside the user’s responses and appear as additional columns in your feedback table. This is useful for capturing page context, app state, or any other information that helps you understand where and when the feedback was given.
Each key becomes a column in the feedback records table (e.g. page_url appears as “Page Url”). All metadata values are stored as strings with category: "metadata".
person vs metadata: Use person for user identity (email, name) — it creates/links a person record in BuildBetter. Use metadata for contextual data about the submission (page URL, plan, app version) — it’s stored as fields on the feedback record itself.

Event Callbacks

React to widget lifecycle events with callback functions.

Examples

A floating NPS survey with optional follow-up, linked to the logged-in user.
A popover button embedded in your documentation pages that captures the current URL automatically.
An inline form embedded in your page for collecting detailed feature requests.
A minimal floating widget with custom emojis for page-level feedback.
A slide-out panel for structured bug reports with severity rating.
A fully dark-themed floating widget. The widget uses theme-relative borders so controls stay visible on dark backgrounds.

Widget Builder

You can build and preview your widget visually inside BuildBetter. Go to Feedback > Widget Builder to configure fields, display mode, and theme with a live interactive preview that runs the real widget, then copy the generated embed code.

Technical Details

Lightweight

~12 KB gzipped. Single JS file, no CSS dependency, no external libraries needed on your page.

Style Isolation

Each widget instance renders inside a Shadow DOM, so its styles never conflict with your page.

Spam Prevention

Built-in 5-second cooldown between submissions. Each submission includes a unique ID for server-side deduplication.

Browser Support

Works in all modern browsers: Chrome, Firefox, Safari, and Edge. See Browser Compatibility for details.

Browser Compatibility

The widget uses Shadow DOM for style isolation, which requires a modern browser. Internet Explorer is not supported.
Internet Explorer 11 and legacy Edge (pre-Chromium) are not supported. The widget will not render in these browsers.